from django.shortcuts import render
from django.http import HttpResponse
# 这种函数表示每个模块的测试地址，如果这个地址是正常的，说明路径是没问题的
def index(request):
    context          = {}
    context['hello'] = 'Hello World! 这里是casedemo6'
    return render(request, 'casedemo6/index.html', context)
def index_demo2(request):
    return render(request,"casedemo6/login.html")
def login(request):
    if request.method=="GET":
        a=request.GET.get('name')
        b=request.GET['pwd']
        context={'name':a,'pwd':b}
        print(str(context))
        return render(request,'casedemo6/404.html',{'name':a,'pwd':b})
    else :
        a=request.POST.get('name')
        b=request.POST['pwd']
        context={'name':a,'pwd':b}
        print(str(context))
    #return render(request, 'casedemo6/404.html', {'name': a, 'pwd': b})
    return render(request,'casedemo6/wecome.html',{'name':a})
